<?php 
/**
 * Distributed under the terms of the Eclipse Public License - v 1.0 (see epl-v10.html)
 *
 * If you use this software please consider contributing your revisions or extensions back
 * to the google code project at: 
 *            http://code.google.com/p/data-lotro-com-php-helper-class/
 *
 * Also consider adding an acknowledgement to your website:
 *  "This site uses the data.lotro.com PHP helper class provided by Chris Thomson and Renkosi.com"
 *
 * This page is used as an example to test the client.
 * Please configure the settings in lotroapi.config.php before using this page.
 *
 * Change Log:
 *
 * v0.1 - Alpha release for testing. (CTHOMSON - 14/4/2009)
 *
 * v0.2 - Updates to test new functionality. (CTHOMSON - 16/5/2009)
 *
 *
 * @author Chris Thomson <renkosi@smog-it.co.uk>
 * @copyright Copyright (c) 2009, Chris Thomson
 * @see lotroapi.config.php
 * @version 0.2
 */

?>
<html>
	<head>
		<title>data.lotro.com helper class example</title>

		<script type="text/javascript" src="http://content.level3.turbine.com/sites/lorebook.lotro.com/js/onering.js"></script>
	</head>
	<body>
	<?php
    	require_once("../src/lotroapi.php");
	    $kinship = "Knights+of+the+White+Lady";
		$world = "Landroval";
		$player = "Valdidar";
		
		$api = new api();
		
		$c = $api->getCharacterSheet($world, $player);
		
		$k = $api->getGuildRoster($world, $kinship);
		
		
	?>
	<h1>Character information for: <?php echo $c->name; ?>(<?php echo $c->level; ?>) a <?php echo $c->cclass; ?> on <?php echo $c->world; ?></h1>
	<?php if($c->monster!=0):?><h2>Is a monster</h2><?php endif; ?>
	<h2><?php echo $c->race; ?> from <?php echo $c->origin; ?></h2>
	<h3>Crafting vocation: <?php echo $c->vocation->name; ?></h3>
	<ul> 
	<?php foreach($c->vocation->professions as $p): ?>
		<li><?php echo $p->name;?> proficient at: <?php 
			switch ($p->proficiency) { 
				case 1: echo "Apprentice"; break; 
				case 2: echo "Journeyman"; break; 
				case 3: echo "Expert"; break; 
				case 4: echo "Artisan"; break; 
				case 5: echo "Master"; break; 
				case 6: echo "Supreme"; break; 
			} ?> mastered: <?php 
			switch ($p->mastery) { 
				case 1: echo "Apprentice"; break; 
				case 2: echo "Journeyman"; break; 
				case 3: echo "Expert"; break; 
				case 4: echo "Artisan"; break; 
				case 5: echo "Master"; break; 
				case 6: echo "Supreme"; break; 
			} ?></li>
	<?php endforeach; ?>
	</ul>
	<h3>Monster play</h3>
	<p>Rank: <?php echo $c->pvmp->gloryRank; ?>, Rating points: <?php echo $c->pvmp->ratingPoints; ?>, Glory points: <?php echo $c->pvmp->gloryPoints; ?></p>
	<h3>Statistics</h3>
		<ul>
	<?php foreach($c->stats as $p): ?>
		<li><?php echo $p->name;?> - <?php echo $p->value;?></li>
	<?php endforeach; ?>
	</ul>
		<h3>Equipment</h3>
		<ul>
	<?php foreach($c->items as $p): ?>
		<li><img src="<?php echo $p->getIconURL(); ?>" /><a href="<?php echo $p->lorebookEntry; ?>"><?php echo $p->name;?></a> - <?php echo $p->slot;?></li>
	<?php endforeach; ?>
	</ul>
	
	<h1>Kinship roster for: <?php echo $k->name; ?>(<?php echo $k->memberCount; ?>) on <?php echo $k->world; ?></h1>
	<h2><?php echo $k->theme; ?></h2>
	<p>Is a <?php  if ($k->isKinship()) echo "kinship"; else echo "tribe"; ?>.</p> 	<ul>
	<?php foreach($k->characters as $char): ?>
	<li><?php echo "name: ".$char->name.", level: ".$char->level." class: ".$char->cclass.", race: ".$char->race." rank: ".$char->rank; ?></li>
	<?php endforeach; ?>
	</ul>

<?php

	$item = $api->getItemInformation("1879097424"); 
	echo $item->toString();	
?>

	</body>
</html>
